package com.zoffy.ybuhelper.adapter;

import android.view.View;
import androidx.annotation.NonNull;
import com.zoffy.ybuhelper.MyApplication;
import com.zoffy.ybuhelper.R;
import com.zoffy.ybuhelper.adapter.ItemControlRecyclerAdapter;
import com.zoffy.ybuhelper.pojo.entity.Origin;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class OriginRecyclerAdapter extends ItemControlRecyclerAdapter {
    public OriginRecyclerAdapter(List<Origin> dataList) {
        super(dataList);
    }

    @Override
    protected void setItemData(@NonNull @NotNull ControlViewHolder holder, int position) {
        Origin origin=(Origin) dataList.get(position);
        holder.informationTextView.setVisibility(View.GONE);
        holder.originTextView.setVisibility(View.GONE);
        holder.nameTextView.setText(origin.getName());
        if(origin.getDeleted()==0){
            holder.deletedTextView.setText("启用");
            holder.deletedTextView.setBackgroundResource(R.color.green);
        }
        else {
            holder.deletedTextView.setText("禁用");
            holder.deletedTextView.setBackgroundResource(R.color.red);
        }
    }
}
